<?php
	class CategoryModel extends Model {
		public function __construct(){
			$this->open(Model::MYSQL);
			$this->calledClass(get_class($this));
		}
		public function display(){
			$this->open(Model::MYSQL);
			return $this->getRecords($fields);
		}
		public function findArray($where=array()){
			$this->open(Model::MYSQL);
			return parent::findAsArray($where);
		}
		public function getAsArray($fields=array()){
			$this->open(Model::MYSQL);
			return parent::getAsArray($fields);
		}
		public function getObject($fields=array()){
			$this->open(Model::MYSQL);
			return parent::findAsObject($fields);
		}
		public function getList($page=1,$perpage=20,$search="",$searchFields=array(),$sortFields=array(),$sortCriteria=""){
			$this->open(Model::MYSQL);
			return parent::getList($page,$perpage,$search,$searchFields,$sortFields,$sortCriteria);
		}
		public function delete($where=array(),$deleteSet=false){
			$this->open(Model::MYSQL);
			return parent::delete($where,$deleteSet);
		}
		public function numRows($result){
			$this->open(Model::MYSQL);
			return is_resource($result)?mysql_num_rows($result):null;
		}
		public function query(){
			$this->open(Model::MYSQL);
			return parent::query("select * from users");
		}
		public function save($fields=array()){
			$this->open(Model::MYSQL);
			return parent::save($fields);
		}
		public function edit($fields=array(),$where=array()){
			$this->open(Model::MYSQL);
			return parent::update($fields,$where);
		}
		/*use*/
		public function findObject($fields=array()){
			$this->open(Model::MYSQL);
			return $this->findAsObject($fields);
		}
	}